﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:CPN.PJN.Silverlight.UI.Controls">

    <Style TargetType="local:NotificationPopup">
        <Setter Property="Foreground" Value="White" />
        <Setter Property="Background">
            <Setter.Value>
                <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                    <LinearGradientBrush.GradientStops>
                        <GradientStopCollection>
                            <GradientStop Color="#FF7A7A7A" Offset="0" />
                            <GradientStop Color="#FF3D3D3D" Offset="1" />
                        </GradientStopCollection>
                    </LinearGradientBrush.GradientStops>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:NotificationPopup">
                    <Grid x:Name="Root" 
                          Visibility="Collapsed" 
                          Cursor="Hand">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="MouseOverBorder">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="NotificationStates">
                                <VisualState x:Name="Show">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="00:00:00" Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Root">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity" BeginTime="00:00:00">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Hide">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity" BeginTime="00:00:00">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.0000000" Value="1"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="00:00:00.3000000" Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Root">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00.3000000">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid>
                            <Border Background="#FF202020" 
                                    BorderBrush="#FFB0B0B0" 
                                    BorderThickness="1"
                                    CornerRadius="5,5,5,5">
                                <Grid Margin="1,1,1,1">
                                    <Border HorizontalAlignment="Stretch"
                                            CornerRadius="3,3,3,3"
                                            Background="{TemplateBinding Background}" 
                                            BorderBrush="{TemplateBinding BorderBrush}" 
                                            BorderThickness="{TemplateBinding BorderThickness}">
                                    </Border>
                                    <TextBox TextAlignment="Center"
                                             Foreground="{TemplateBinding Foreground}" 
                                             Text="{TemplateBinding Message}"
                                             IsReadOnly="True"
                                             Background="Transparent"
                                             BorderThickness="0"
                                             TextWrapping="Wrap" 
                                             FontSize="12" 
                                             Margin="5,5,5,5">
                                        <TextBox.Template>
                                            <ControlTemplate TargetType="TextBox">
                                                <Grid x:Name="RootElement">
                                                    <ScrollViewer x:Name="ContentElement" 
                                                                  FontWeight="{TemplateBinding FontWeight}" 
                                                                  FontFamily="{TemplateBinding FontFamily}" 
        					                                      Background="{TemplateBinding Background}" 
                                                                  FontSize="{TemplateBinding FontSize}" 
                                                                  BorderThickness="0"
                                                                  Padding="{TemplateBinding Padding}" 
                                                                  Cursor="IBeam"/>
                                                </Grid>
                                            </ControlTemplate>
                                        </TextBox.Template>
                                    </TextBox>
                                </Grid>
                            </Border>
                            <Border BorderThickness="2,2,2,2" 
                                    CornerRadius="5,5,5,5"
                                    Background="#10FFFFFF"
                                    Opacity="0"
                                    x:Name="MouseOverBorder"/>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
